# from flask import  Blueprint,request,redirect,session
# bp = Blueprint('read_report_bp',__name__,url_prefix='/read')
# from flask_login import login_required
# from utils.decorator import json_response
# from blueprint.read_report_bp_Impl import *
#
#
# """
# **************规定*************
# 时间以‘-’作为分隔符，精确到年月日时分秒；时间选择器在精确到时分秒查询时会出现问题，前端做选择器精确到日期即可。
# 三项日报内容以/*/*/为分隔符
# **************规定*************
# """
#
# """
# 第一部分，查自己作为发送人的相关日报信息。类似邮箱的已发信息已发信息。
# """
#
# # 根据传入的当前用户的日报id，返回具体单条日报的信息（业务逻辑对应为用户查看某一条具体的日报）
# @bp.route('/read_report_by_id_sent')
# @json_response
# @login_required
# def read_Report_by_Id_sent():
#     log_id = request.args.get('log_id','')
#     login_name = session.get('login_name')
#     if log_id == None or log_id == '':
#         return dict(success=False, msg='wrong input data.',code=100)
#     if login_name == None:
#         return dict(success=False, msg='wrong input data.', code=900)
#     try:
#         res = read_Report_by_Id_Impl(login_name,log_id)
#         # return dict(success=True,data=res)
#     except Exception as err:
#         return dict(success=True, msg='日报查询出现错误。',code=800)
#     try:
#         return dict(success=True, data=uniform_report_data(res))
#     except Exception as err:
#         return dict(success=True, msg='结果封装出现错误。', code=1000)
#
# # 筛选器查询整合，做时间、项目组或部门，标题模糊匹配的查找。其中项目组和部门的筛选器需要和前端对接好（部门或项目组做下拉选择）。
# @bp.route('/read_report_sent')
# @json_response
# @login_required
# def read_report_sent():
#     # get请求传参，如果不带后台的参数，则后台获取为None，如果带参数但未付值，则后台获取为'';
#     project_id = request.args.get("project_id")
#     department_id = request.args.get("department_id")
#     start_time = request.args.get("start_time")
#     end_time = request.args.get("end_time")
#     title_match = request.args.get("title_match")
#     login_name = session['login_name']
#     if login_name == None:
#         return dict(success=False, msg='获取不到登陆用户信息.', code=900)
#     # res = read_report_sent_impl(start_time, end_time, project_id, department_id, title_match, login_name)
#     try:
#         print()
#         res = read_report_sent_impl(start_time,end_time,project_id,department_id,title_match,login_name)
#         return dict(success=True,data=uniform_report_data(res))
#     except Exception as err:
#         print(err)
#         return dict(success=False, msg='查询日报信息失败.', code=800)
#
#
# """
# 第二部分，查自己作为接受者的相关日报信息。类似邮箱的已发信息收件箱。
# """
# # 根据传入的当前用户的日报id，返回具体单条日报的信息（业务逻辑对应为用户查看某一条具体的日报）,后台标注此信息已被读取过
# @bp.route('/read_report_by_id_receiver')
# @json_response
# @login_required
# def read_Report_by_Id_receiver():
#     log_id = request.args.get('log_id','')
#     login_name = session.get('login_name')
#     if log_id == None or log_id == '':
#         return dict(success=False, msg='wrong input data.',code=100)
#     if login_name == None:
#         return dict(success=False, msg='wrong input data.', code=900)
#     try:
#         res = read_Report_by_Id_receiver_Impl(login_name,log_id)
#         # return dict(success=True,data=res)
#     except Exception as err:
#         return dict(success=True, msg='日报查询出现错误。',code=800)
#     try:
#         return dict(success=True, data=uniform_report_data(res))
#     except Exception as err:
#         return dict(success=True, msg='结果封装出现错误。', code=1000)
#
# # 筛选器查询整合，做时间、项目组或部门，标题模糊匹配的查找。其中项目组和部门的筛选器需要和前端对接好（部门或项目组做下拉选择）。
# @bp.route('/read_report_receiver')
# @json_response
# @login_required
# def read_report_receiver():
#     # get请求传参，如果不带后台的参数，则后台获取为None，如果带参数但未付值，则后台获取为'';
#     project_id = request.args.get("project_id")
#     department_id = request.args.get("department_id")
#     start_time = request.args.get("start_time")
#     end_time = request.args.get("end_time")
#     title_match = request.args.get("title_match")
#     login_name = session['login_name']
#     if login_name == None:
#         return dict(success=False, msg='获取不到登陆用户信息.', code=900)
#     try:
#         print()
#         res = read_report_receiver_impl(start_time,end_time,project_id,department_id,title_match,login_name)
#         return dict(success=True,data=uniform_report_data(res))
#     except Exception as err:
#         print(err)
#         return dict(success=False, msg='查询日报信息失败.', code=800)